package org.jeecg.modules.online.desform.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.online.desform.entity.DesignFormData;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: 表单设计数据
 * @Author: jeecg-boot
 * @Date: 2019-05-16
 * @Version: V1.0
 */
public interface DesignFormDataMapper extends BaseMapper<DesignFormData> {

	/**
	 * 通过主表ID删除数据
	 * 
	 * @param mainId
	 * @return
	 */
	public boolean deleteByMainId(@Param("mainId") String mainId);

	/**
	 * 通过主表ID查询数据
	 * 
	 * @param mainId
	 * @return
	 */
	public List<DesignFormData> selectByMainId(@Param("mainId") String mainId);

	/**
	 * 查询一张表的一条记录
	 * 该查询是查询所有字段即select * from {table} where id = {onlineDataId}
	 * @param tbname 表名
	 * @param onlineDataId 数据id
	 * @return
	 */
	public Map<String,Object> queryOneByTableNameAndId(@Param("tbname")String tbname, @Param("onlineDataId")String onlineDataId);

	/**
	 * 通过表名获取子表配置
	 * @param table_name
	 * @return
	 */
	public String getSubTablesByTableName(String table_name);
}
